package com.phpxiu.app.presenters;

import android.content.Context;
import android.widget.Toast;

import com.phpxiu.app.controller.avcontroller.QavsdkControl;
import com.phpxiu.app.utils.KKYUtil;
import com.tencent.TIMLogLevel;
import com.tencent.TIMManager;

import tencent.tls.platform.TLSAccountHelper;
import tencent.tls.platform.TLSLoginHelper;

/**
 * 初始化
 * 包括imsdk等
 */
@Deprecated
public class InitBusinessHelper {
    private static String TAG = "InitBusinessHelper";
    private InitBusinessHelper() {
    }
    public static TLSLoginHelper getmLoginHelper() {
        return mLoginHelper;
    }
    public static TLSAccountHelper getmAccountHelper() {
        return mAccountHelper;
    }
    private static TLSLoginHelper mLoginHelper;
    private static TLSAccountHelper mAccountHelper;
    private static String appVer = "1.0";
    /**
     * 初始化App
     */
    public static void initApp(Context context) {
        //初始化avsdk imsdk
        QavsdkControl.initQavsdk(context);
        //是否控制抬输出IM日志
        TIMManager.getInstance().setLogPrintEnable(false);
        //灯塔上报
        TIMManager.getInstance().disableBeaconReport();
        //IM AV SDK日志上报
        TIMManager.getInstance().setLogLevel(TIMLogLevel.OFF);
        //IM 实例初始化
        TIMManager.getInstance().init(context);
        //设调显示IM SDK版本号
        if(KKYUtil.DEBUG){
            String IMVersion= TIMManager.getInstance().getVersion();
            Toast.makeText(context,"IMSDK版本号："+IMVersion,Toast.LENGTH_LONG).show();
        }
        //初始化CrashReport
        //CrashHandler crashHandler = CrashHandler.getInstance();
        //crashHandler.init(context);
    }
}
